# 读取json文件，将[{},{},{}]转为[(),(),()]
# unittest框架支持数据格式[(),(),()]
# pytest框架[(),(),()],[[],[],[]]
# pytest框架支持unittest
# "C:\jiekou\day0301\data\zshj_login.json"
import json

from config import BASE_PATH


def read_json(filename):
    # 打开文件
    with open(filename,"r",encoding="utf-8")as f:


        json_data=json.load(f)
        # print(json_data)
        # 格式转换[{},{},{}]转换为[(),(),()]
        list_login=[]
        for i in json_data:
            tmp=tuple(i.values())
            list_login.append(tmp)
    # 返回
        return list_login

if __name__ == '__main__':
    filename= BASE_PATH+"/data/role_query.json"
    res=read_json(filename)
    print(res)
